<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

欢迎：<span th:if="${session.user != null}" th:text="${session.user.userName}"></span>
        <span th:if="${session.user == null}" th:text="游客"></span>

<table style="width: 600px" border="1" align="center" >
    <caption>列表</caption>
    <thead>
    <tr >
        <th >编号</th>
        <th >姓名</th>
        <th >年龄</th>
        <th >头像</th>
        <th >生日</th>
        <th >操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="employee, state:${employeeList}" th:style="${state.odd?'background: #cac6c6':'background: whitesmoke'}">
        <td th:text="${employee.id}"></td>
        <td th:text="${employee.userName}"></td>
        <td th:text="${employee.age}"></td>
        <td><img th:src="@{/} + ${employee.photo}"></td>
        <td th:text="${#temporals.format(employee.birthday, 'yyyy/MM/dd')}"></td>
        <td>
            &nbsp;&nbsp;&nbsp;&nbsp;<a href="/employee/delete">删除</a>&nbsp;&nbsp;<a href="/employee/update">修改</a>
        </td>
<!--        <td th:if="${b.price}>1">太贵</td>-->
    </tr>
    </tbody>
</table>
<div>
    <input type="button" value="添加员工" onclick="addEmp()">
    <button type="submit" onclick="addEmp()">添加员工</button>
    <script>
        function addEmp(){
            location.href = "addEmp";
        }
    </script>

</div>

</body>

</html>

<style>
    table {
        border-radius: 10px;
        background-clip: padding-box;
        padding: 15px 35px 15px 35px;
        background: rgb(141, 222, 215);
        border: 1px solid #eaeaea;
        box-shadow: 0 0 25px #cac6c6;
        align-content: center;
    }
</style>